from os.path import join, dirname

from pgtools.plugins.db.entity import BaseEntity

db_file = join(dirname(__file__), 'db.sqlite3')

class Department(BaseEntity):
    def __init__(self):
        super().__init__('department', db_file)

dep = Department()
print(dep.get_all())
print(dep.get((),[['id', 1]]))
print(dep.get_one(id=1))
print(dep.get_multi(parent=1))
print(dep.count())

user = BaseEntity('user', db_file)
print(user.get_all())